<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>hello div</div>
    <p>hello p</p>
    <script>
      console.log(document.body.childNodes);

      // document.body.childNodes.forEach((el) => {
      //   console.log(el);
      // });

      // for (let v of document.body.childNodes) {
      //   console.log(v);
      // }

      // [...'abc']
      // console.log([...document.body.childNodes.entries()]);
      console.log([...document.body.childNodes]); // 将可迭代对象转二维数组
      console.log([...document.body.childNodes.keys()]);
      console.log([...document.body.childNodes.values()]);
      
      console.log(Array.from(document.body.childNodes.values()));
    </script>
  </body>
</html>
